//
//  avatarLayer.m
//  pipi
//
//  Created by rexzhao on 11-5-18.
//  Copyright 2011 no. All rights reserved.
//

#import "avatarLayer.h"
#import "startupLayer.h"

@implementation avatarLayer
+(CCScene *) scene {
	// 'scene' is an autorelease object.
	CCScene *scene = [CCScene node];
	
	// 'layer' is an autorelease object.
	avatarLayer *layer = [avatarLayer node];
	
	// add layer as a child to scene
	[scene addChild: layer];
	
	// return the scene
	return scene;
}

-(void) LoadAvatar {
	
}

-(void) OnUse:(id)sender {
	
}

-(void) OnBack:(id)sender {
	[[CCDirector sharedDirector] replaceScene:[startupLayer node]];
}

-(id) init {
	if ((self = [super init])) {
		[self LoadAvatar];
		
		CCMenuItem * use = [CCMenuItemFont itemFromString:@"[Use]" target:self selector:@selector(OnUse:)];
		use.position = ccp(100, 50);
		
		CCMenuItem * back = [CCMenuItemFont itemFromString:@"[Back]" target:self selector:@selector(OnBack:)];
		back.position = ccp(300, 50);

		CCMenu * menu = [CCMenu menuWithItems:use, back, nil];
		menu.position = ccp(0, 0);
		
		[self addChild:menu];
	}
	return self;
}
@end
